	//This is the E100 mouse driver.
	
	//It takes no inputs.
	//It outputs mouse_deltax (right = + ), mouse_deltay (down = +), and mousebutton[1-3].
	
	//By Kwesi Rutledge

	//List of ports
	//70	out	bit0: 		mouse_command
	//71	in	bit0: 		mouse_response
	//72	in	bits 15-0: 	mouse_deltax
	//73	in	bits 15-0: 	mouse_deltay
	//74	in	bit 0: 		mouse_button1
	//75	in	bit 0: 		mouse_button2
	//76	in	bit 0: 		mouse_button3

mouse			out 70 mouse_one							//puts command high which will tell the mouse to send data.

mouse_replying	in 71 mouse_reply							//I think that we will want this to be a loop that waits for a response.
				bne mouse_replying mouse_reply mouse_one	//If you don't get a response keep looking for one.

				in 72 mouse_deltax							//Now, we're gathering the information once we receive our cue. 
				in 73 mouse_deltay
				in 74 mouse_button1
				in 75 mouse_button2
				in 76 mouse_button3							//Now we have our information.

mouse_received	out 70 mouse_zero							//Lower command to tell mouse that we have received.

mouse_replied	in 71 mouse_reply							//Eventually mouse will lower response, in response.
				be mouse_received mouse_reply mouse_one		//If the response line is high, go back to checking to see if it is still high.

				ret mouse_return							//Return to the point in the program from which this driver was called.

mouse_one		.data 1
mouse_zero		.data 0
mouse_reply   	.data 0
mouse_deltax 	.data 0
mouse_deltay 	.data 0
mouse_button1	.data 0
mouse_button2	.data 0
mouse_button3	.data 0
mouse_return 	.data 0
